import request from '@/utils/request'

/**
 * 删除部门详情接口方法
 * @param {number} id 部门id
 */
export const deleteDepartmentAPI = (id) => {
  return request.delete(`/company/department/${id}`)
}

/**
 * 更新部门详情数据接口方法
 * @param {object} data 要更新的部门表单数据对象
 */
export const updateDepartmentAPI = (data) => {
  return request.put(`/company/department/${data.id}`, data)
}

/**
 * 获取部门详情数据接口方法
 * @param {number} id 部门ID
 */
export const getDepartmentDetailAPI = (id) => {
  return request.get(`/company/department/${id}`)
}

/**
 * 新增子部门接口方法
 * @param {object} data 新增部门表单数据对象
 */
export const addDepartmentAPI = (data) => {
  return request.post('/company/department', data)
}

/**
 * 获取部门负责人数据接口方法
 */
export const getManagerListAPI = () => {
  return request.get('/sys/user/simple')
}

/**
 * 获取部门列表数据接口方法
 */
export const getDepartmentsAPI = () => {
  return request.get('/company/department')
}
